﻿@using GridMvc.Html
@using i18n
@using Microsoft.AspNet.Identity

@model Plugin.Payment.Stripe.Models.OrderTransactionModel

@section Styles {
    <link href="~/Content/Gridmvc.css" rel="stylesheet" />
    <link href="~/Content/gridmvc.datepicker.min.css" rel="stylesheet" />
}


@helper DisplayStatus(bool paid)
{
    if (paid)
    {
        <span class="label label-success">Paid</span>
    }
    else
    {
        <span class="label label-info">Pending</span>
    }
}

<div class="panel-body">
    <h4><i class="fa fa-cc-stripe"></i> Stripe Transaction</h4>
    <hr />

    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            @Html.Grid(Model.TransactionPayment).SetLanguage(Context.GetPrincipalAppLanguageForRequest().ToString()).EmptyText("[[[There are no items to display.]]]").Columns(columns =>
       {
           columns.Add()
             .Encoded(false)
             .Sanitized(false)
             .RenderValueAs(x => DisplayStatus(x.IsCaptured));

           columns.Add(x => x.Created).Titled("Date").RenderValueAs(x => x.Created.ToShortDateString());
           columns.Add(x => x.OrderID).Titled("OrderID");
           columns.Add(x => x.Order.Description).Titled("Description");
           columns.Add(x => x.Order.PriceFormatted).Titled("Price");

       }).WithPaging(10).Selectable(false)
        </div>
    </div>

</div>



@section Scripts {
    <script src="~/Scripts/gridmvc.min.js"></script>
    @Html.Partial("_LocalizationGridMvc")
}
